#ifndef _TWITTER_IOAUTH_H_
#define _TWITTER_IOAUTH_H_

#include <string>
#include <map>
#include "CommonMacros.h"
#include "response.h"

#ifndef HAVE_RESPONSE_CALLBACK
#define HAVE_RESPONSE_CALLBACK
typedef size_t (*response_callback)(void *ptr, size_t size, size_t nmemb, void *userData);
#endif
NS_BEGIN(Twit)

#ifndef HAVE_REQUEST_METHOD
#define HAVE_REQUEST_METHOD
typedef enum RequestMethod
{
	RequestMethodGet	= 0,
	RequestMethodPost	= 1,
	RequestMethodDelete	= 2
}RequestMethod;
#endif /*HAVE_REQUEST_METHOD*/


class OAuthToken:public response
{
public:
   OAuthToken(){}
   OAuthToken(const response& o):response(o){}
   std::string 
      token,
      tokenSecret;
   std::map<std::string,std::string> addtional;

};

struct IOAuth
{
   virtual void request(response& out, std::string& reqUri, RequestMethod method=RequestMethodGet)=0;
   virtual void request(response& out, const char* reqUri, RequestMethod method=RequestMethodGet)=0;
   virtual void requestStream(response& out, std::string& reqUri, response_callback resFunc, void* userData)=0;
   virtual bool isValidAccessToken()=0;
};


NS_END;
#endif /*_TWITTER_IOAUTH_H_*/

